/*******************************************************************************
 * Copyright (c) 2001, 2019 IBM Corp. and others
 *
 * This program and the accompanying materials are made available under
 * the terms of the Eclipse Public License 2.0 which accompanies this
 * distribution and is available at https://www.eclipse.org/legal/epl-2.0/
 * or the Apache License, Version 2.0 which accompanies this distribution and
 * is available at https://www.apache.org/licenses/LICENSE-2.0.
 *
 * This Source Code may also be made available under the following
 * Secondary Licenses when the conditions for such availability set
 * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
 * General Public License, version 2 with the GNU Classpath
 * Exception [1] and GNU General Public License, version 2 with the
 * OpenJDK Assembly Exception [2].
 *
 * [1] https://www.gnu.org/software/classpath/license.html
 * [2] http://openjdk.java.net/legal/assembly-exception.html
 *
 * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
 *******************************************************************************/
#if !defined(hyporterror_h)
#define hyporterror_h

#define HYPORT_ERROR_BASE -1
#define HYPORT_ERROR_OPFAILED HYPORT_ERROR_BASE
#define HYPORT_ERROR_EOF HYPORT_ERROR_BASE-1
#define HYPORT_ERROR_NOPERMISSION HYPORT_ERROR_BASE-2
#define HYPORT_ERROR_NOTFOUND HYPORT_ERROR_BASE-3
#define HYPORT_ERROR_NAMETOOLONG HYPORT_ERROR_BASE-4
#define HYPORT_ERROR_DISKFULL HYPORT_ERROR_BASE-5
#define HYPORT_ERROR_EXIST HYPORT_ERROR_BASE-6
#define HYPORT_ERROR_NOTEXIST HYPORT_ERROR_BASE-7
#define HYPORT_ERROR_SYSTEMFULL HYPORT_ERROR_BASE-8
#define HYPORT_ERROR_NOENT HYPORT_ERROR_BASE-9
#define HYPORT_ERROR_DIRECTORY HYPORT_ERROR_BASE-10
#define HYPORT_ERROR_NOTDIRECTORY HYPORT_ERROR_BASE-11
#define HYPORT_ERROR_LOOP HYPORT_ERROR_BASE-12
#define HYPORT_ERROR_BADF HYPORT_ERROR_BASE-13
#define HYPORT_ERROR_WOULDBLOCK HYPORT_ERROR_BASE-14
#define HYPORT_ERROR_INVALID HYPORT_ERROR_BASE-15

#define HYPORT_ERROR_STARTUP_BASE -100
#define HYPORT_ERROR_STARTUP_THREAD (HYPORT_ERROR_STARTUP_BASE)
#define HYPORT_ERROR_STARTUP_MEM (HYPORT_ERROR_STARTUP_BASE -1)
#define HYPORT_ERROR_STARTUP_TLS (HYPORT_ERROR_STARTUP_BASE -2)
#define HYPORT_ERROR_STARTUP_TLS_ALLOC (HYPORT_ERROR_STARTUP_BASE -3)
#define HYPORT_ERROR_STARTUP_TLS_MUTEX (HYPORT_ERROR_STARTUP_BASE -4)
#define HYPORT_ERROR_STARTUP_CPU (HYPORT_ERROR_STARTUP_BASE -5)
#define HYPORT_ERROR_STARTUP_VMEM (HYPORT_ERROR_STARTUP_BASE -6)
#define HYPORT_ERROR_STARTUP_FILE (HYPORT_ERROR_STARTUP_BASE -7)
#define HYPORT_ERROR_STARTUP_TTY (HYPORT_ERROR_STARTUP_BASE -8)
#define HYPORT_ERROR_STARTUP_TTY_HANDLE (HYPORT_ERROR_STARTUP_BASE -9)
#define HYPORT_ERROR_STARTUP_TTY_CONSOLE (HYPORT_ERROR_STARTUP_BASE -10)
#define HYPORT_ERROR_STARTUP_MMAP (HYPORT_ERROR_STARTUP_BASE -11)
#define HYPORT_ERROR_STARTUP_IPCMUTEX (HYPORT_ERROR_STARTUP_BASE -12)
#define HYPORT_ERROR_STARTUP_NLS (HYPORT_ERROR_STARTUP_BASE -13)
#define HYPORT_ERROR_STARTUP_SOCK (HYPORT_ERROR_STARTUP_BASE -14)
#define HYPORT_ERROR_STARTUP_TIME (HYPORT_ERROR_STARTUP_BASE -15)
#define HYPORT_ERROR_STARTUP_GP (HYPORT_ERROR_STARTUP_BASE -16)
#define HYPORT_ERROR_STARTUP_EXIT (HYPORT_ERROR_STARTUP_BASE -17)
#define HYPORT_ERROR_STARTUP_SYSINFO (HYPORT_ERROR_STARTUP_BASE -18)
#define HYPORT_ERROR_STARTUP_SL (HYPORT_ERROR_STARTUP_BASE -19)
#define HYPORT_ERROR_STARTUP_STR (HYPORT_ERROR_STARTUP_BASE -20)
#define HYPORT_ERROR_STARTUP_SHSEM (HYPORT_ERROR_STARTUP_BASE -21)
#define HYPORT_ERROR_STARTUP_SHMEM (HYPORT_ERROR_STARTUP_BASE -22)
#define HYPORT_ERROR_STARTUP_ERROR (HYPORT_ERROR_STARTUP_BASE -23)
#define HYPORT_ERROR_STARTUP_SIGNAL (HYPORT_ERROR_STARTUP_BASE -24)

#define HYPORT_ERROR_SHSEM_BASE -150
#define HYPORT_ERROR_SHSEM_OPFAILED (HYPORT_ERROR_SHSEM_BASE)
#define HYPORT_ERROR_SHSEM_HANDLE_INVALID (HYPORT_ERROR_SHSEM_BASE-1)
#define HYPORT_ERROR_SHSEM_SEMSET_INVALID (HYPORT_ERROR_SHSEM_BASE-2)
#define HYPORT_ERROR_SHSEM_OPFAILED_DONT_UNLINK (HYPORT_ERROR_SHSEM_BASE-3)
#define HYPORT_ERROR_SHSEM_OPFAILED_CONTROL_FILE_CORRUPT (HYPORT_ERROR_SHSEM_BASE-4)
#define HYPORT_ERROR_SHSEM_OPFAILED_SEMID_MISMATCH (HYPORT_ERROR_SHSEM_BASE-5)
#define HYPORT_ERROR_SHSEM_OPFAILED_SEM_KEY_MISMATCH (HYPORT_ERROR_SHSEM_BASE-6)
#define HYPORT_ERROR_SHSEM_OPFAILED_SEM_SIZE_CHECK_FAILED (HYPORT_ERROR_SHSEM_BASE-7)
#define HYPORT_ERROR_SHSEM_OPFAILED_SEM_MARKER_CHECK_FAILED (HYPORT_ERROR_SHSEM_BASE-8)
#define HYPORT_ERROR_SHSEM_DATA_DIRECTORY_FAILED (HYPORT_ERROR_SHSEM_BASE-9)
#define HYPORT_ERROR_SHSEM_WAIT_FOR_CREATION_MUTEX_TIMEDOUT (HYPORT_ERROR_SHSEM_BASE-10)
#define HYPORT_ERROR_SHSEM_STAT_BUFFER_INVALID (HYPORT_ERROR_SHSEM_BASE-11)
#define HYPORT_ERROR_SHSEM_STAT_FAILED (HYPORT_ERROR_SHSEM_BASE-12)
#define HYPORT_ERROR_SHSEM_OPFAILED_SEMAPHORE_NOT_FOUND (HYPORT_ERROR_SHSEM_BASE-13)
#define HYPORT_ERROR_SHSEM_OPFAILED_CONTROL_FILE_LOCK_FAILED (HYPORT_ERROR_SHSEM_BASE-14)

#define HYPORT_ERROR_SHMEM_BASE -170
#define HYPORT_ERROR_SHMEM_OPFAILED (HYPORT_ERROR_SHMEM_BASE)
#define HYPORT_ERROR_SHMEM_OPEN_ATTACHED_FAILED (HYPORT_ERROR_SHMEM_BASE-1)
#define HYPORT_ERROR_SHMEM_CREATE_ATTACHED_FAILED (HYPORT_ERROR_SHMEM_BASE-2)
#define HYPORT_ERROR_SHMEM_NOSPACE (HYPORT_ERROR_SHMEM_BASE-3)
#define HYPORT_ERROR_SHMEM_TOOBIG (HYPORT_ERROR_SHMEM_BASE-4)
#define HYPORT_ERROR_SHMEM_DATA_DIRECTORY_FAILED (HYPORT_ERROR_SHMEM_BASE-5)
#define HYPORT_ERROR_SHMEM_WAIT_FOR_CREATION_MUTEX_TIMEDOUT (HYPORT_ERROR_SHMEM_BASE-6)
#define HYPORT_ERROR_SHMEM_ZOS_STORAGE_KEY_READONLY (HYPORT_ERROR_SHMEM_BASE-7)
#define HYPORT_ERROR_SHMEM_OPFAILED_CONTROL_FILE_CORRUPT (HYPORT_ERROR_SHMEM_BASE-8)
#define HYPORT_ERROR_SHMEM_OPFAILED_SHMID_MISMATCH (HYPORT_ERROR_SHMEM_BASE-9)
#define HYPORT_ERROR_SHMEM_OPFAILED_SHM_KEY_MISMATCH (HYPORT_ERROR_SHMEM_BASE-10)
#define HYPORT_ERROR_SHMEM_OPFAILED_SHM_GROUPID_CHECK_FAILED (HYPORT_ERROR_SHMEM_BASE-11)
#define HYPORT_ERROR_SHMEM_OPFAILED_SHM_USERID_CHECK_FAILED (HYPORT_ERROR_SHMEM_BASE-12)
#define HYPORT_ERROR_SHMEM_OPFAILED_SHM_SIZE_CHECK_FAILED (HYPORT_ERROR_SHMEM_BASE-13)
#define HYPORT_ERROR_SHMEM_HANDLE_INVALID (HYPORT_ERROR_SHMEM_BASE-14)
#define HYPORT_ERROR_SHMEM_STAT_BUFFER_INVALID (HYPORT_ERROR_SHMEM_BASE-15)
#define HYPORT_ERROR_SHMEM_STAT_FAILED (HYPORT_ERROR_SHMEM_BASE-16)
#define HYPORT_ERROR_SHMEM_OPFAILED_SHARED_MEMORY_NOT_FOUND (HYPORT_ERROR_SHMEM_BASE-17)
#define HYPORT_ERROR_SHMEM_OPFAILED_CONTROL_FILE_LOCK_FAILED (HYPORT_ERROR_SHMEM_BASE-18)
#define HYPORT_ERROR_SHMEM_GET_DIR_BUF_OVERFLOW (HYPORT_ERROR_SHMEM_BASE-19)
#define HYPORT_ERROR_SHMEM_GET_DIR_FAILED_TO_GET_HOME (HYPORT_ERROR_SHMEM_BASE-20)
#define HYPORT_ERROR_SHMEM_GET_DIR_HOME_BUF_OVERFLOW (HYPORT_ERROR_SHMEM_BASE-21)
#define HYPORT_ERROR_SHMEM_GET_DIR_HOME_ON_NFS (HYPORT_ERROR_SHMEM_BASE-22)
#define HYPORT_ERROR_SHMEM_GET_DIR_CANNOT_STAT_HOME	(HYPORT_ERROR_SHMEM_BASE-23)

#define HYPORT_ERROR_SOCKET_BASE -200
#define HYPORT_ERROR_SOCKET_BADSOCKET HYPORT_ERROR_SOCKET_BASE
#define HYPORT_ERROR_SOCKET_NOTINITIALIZED HYPORT_ERROR_SOCKET_BASE-1
#define HYPORT_ERROR_SOCKET_BADAF HYPORT_ERROR_SOCKET_BASE-2
#define HYPORT_ERROR_SOCKET_BADPROTO HYPORT_ERROR_SOCKET_BASE-3
#define HYPORT_ERROR_SOCKET_BADTYPE HYPORT_ERROR_SOCKET_BASE-4
#define HYPORT_ERROR_SOCKET_SYSTEMBUSY HYPORT_ERROR_SOCKET_BASE-5
#define HYPORT_ERROR_SOCKET_SYSTEMFULL HYPORT_ERROR_SOCKET_BASE-6
#define HYPORT_ERROR_SOCKET_NOTCONNECTED HYPORT_ERROR_SOCKET_BASE-7
#define HYPORT_ERROR_SOCKET_INTERRUPTED	HYPORT_ERROR_SOCKET_BASE-8
#define HYPORT_ERROR_SOCKET_TIMEOUT	HYPORT_ERROR_SOCKET_BASE-9
#define HYPORT_ERROR_SOCKET_CONNRESET HYPORT_ERROR_SOCKET_BASE-10
#define HYPORT_ERROR_SOCKET_WOULDBLOCK	 HYPORT_ERROR_SOCKET_BASE-11
#define HYPORT_ERROR_SOCKET_ADDRNOTAVAIL HYPORT_ERROR_SOCKET_BASE-12
#define HYPORT_ERROR_SOCKET_ADDRINUSE HYPORT_ERROR_SOCKET_BASE-13
#define HYPORT_ERROR_SOCKET_NOTBOUND HYPORT_ERROR_SOCKET_BASE-14
#define HYPORT_ERROR_SOCKET_UNKNOWNSOCKET HYPORT_ERROR_SOCKET_BASE-15
#define HYPORT_ERROR_SOCKET_INVALIDTIMEOUT HYPORT_ERROR_SOCKET_BASE-16
#define HYPORT_ERROR_SOCKET_FDSETFULL HYPORT_ERROR_SOCKET_BASE-17
#define HYPORT_ERROR_SOCKET_TIMEVALFULL HYPORT_ERROR_SOCKET_BASE-18
#define HYPORT_ERROR_SOCKET_REMSOCKSHUTDOWN HYPORT_ERROR_SOCKET_BASE-19
#define HYPORT_ERROR_SOCKET_NOTLISTENING HYPORT_ERROR_SOCKET_BASE-20
#define HYPORT_ERROR_SOCKET_NOTSTREAMSOCK HYPORT_ERROR_SOCKET_BASE-21
#define HYPORT_ERROR_SOCKET_ALREADYBOUND HYPORT_ERROR_SOCKET_BASE-22
#define HYPORT_ERROR_SOCKET_NBWITHLINGER HYPORT_ERROR_SOCKET_BASE-23
#define HYPORT_ERROR_SOCKET_ISCONNECTED HYPORT_ERROR_SOCKET_BASE-24
#define HYPORT_ERROR_SOCKET_NOBUFFERS HYPORT_ERROR_SOCKET_BASE-25
#define HYPORT_ERROR_SOCKET_HOSTNOTFOUND HYPORT_ERROR_SOCKET_BASE-26
#define HYPORT_ERROR_SOCKET_NODATA HYPORT_ERROR_SOCKET_BASE-27
#define HYPORT_ERROR_SOCKET_BOUNDORCONN HYPORT_ERROR_SOCKET_BASE-28
#define HYPORT_ERROR_SOCKET_OPNOTSUPP HYPORT_ERROR_SOCKET_BASE-29
#define HYPORT_ERROR_SOCKET_OPTUNSUPP HYPORT_ERROR_SOCKET_BASE-30
#define HYPORT_ERROR_SOCKET_OPTARGSINVALID HYPORT_ERROR_SOCKET_BASE-31
#define HYPORT_ERROR_SOCKET_SOCKLEVELINVALID HYPORT_ERROR_SOCKET_BASE-32
#define HYPORT_ERROR_SOCKET_TIMEOUTFAILURE HYPORT_ERROR_SOCKET_BASE-33
#define HYPORT_ERROR_SOCKET_SOCKADDRALLOCFAIL HYPORT_ERROR_SOCKET_BASE-34
#define HYPORT_ERROR_SOCKET_FDSET_SIZEBAD HYPORT_ERROR_SOCKET_BASE-35
#define HYPORT_ERROR_SOCKET_UNKNOWNFLAG HYPORT_ERROR_SOCKET_BASE-36
#define HYPORT_ERROR_SOCKET_MSGSIZE HYPORT_ERROR_SOCKET_BASE-37
#define HYPORT_ERROR_SOCKET_NORECOVERY HYPORT_ERROR_SOCKET_BASE-38
#define HYPORT_ERROR_SOCKET_ARGSINVALID HYPORT_ERROR_SOCKET_BASE-39
#define HYPORT_ERROR_SOCKET_BADDESC HYPORT_ERROR_SOCKET_BASE-40
#define HYPORT_ERROR_SOCKET_NOTSOCK HYPORT_ERROR_SOCKET_BASE-41
#define HYPORT_ERROR_SOCKET_HOSTENTALLOCFAIL HYPORT_ERROR_SOCKET_BASE-42
#define HYPORT_ERROR_SOCKET_TIMEVALALLOCFAIL HYPORT_ERROR_SOCKET_BASE-43
#define HYPORT_ERROR_SOCKET_LINGERALLOCFAIL HYPORT_ERROR_SOCKET_BASE-44
#define HYPORT_ERROR_SOCKET_IPMREQALLOCFAIL HYPORT_ERROR_SOCKET_BASE-45
#define HYPORT_ERROR_SOCKET_FDSETALLOCFAIL HYPORT_ERROR_SOCKET_BASE-46
#define HYPORT_ERROR_SOCKET_OPFAILED HYPORT_ERROR_SOCKET_BASE-47
#define HYPORT_ERROR_SOCKET_VALUE_NULL HYPORT_ERROR_SOCKET_BASE-48
#define HYPORT_ERROR_SOCKET_CONNECTION_REFUSED HYPORT_ERROR_SOCKET_BASE-49
#define HYPORT_ERROR_SOCKET_ENETUNREACH HYPORT_ERROR_SOCKET_BASE-50
#define HYPORT_ERROR_SOCKET_EACCES HYPORT_ERROR_SOCKET_BASE-51
#define HYPORT_ERROR_SOCKET_WAS_CLOSED (HYPORT_ERROR_SOCKET_BASE-52)
#define HYPORT_ERROR_SOCKET_EINPROGRESS (HYPORT_ERROR_SOCKET_BASE-53)
#define HYPORT_ERROR_SOCKET_ALREADYINPROGRESS (HYPORT_ERROR_SOCKET_BASE-54)
#define HYPORT_ERROR_SOCKET_NOSR (HYPORT_ERROR_SOCKET_BASE-55)
#define HYPORT_ERROR_SOCKET_IO  (HYPORT_ERROR_SOCKET_BASE-56)
#define HYPORT_ERROR_SOCKET_ISDIR  (HYPORT_ERROR_SOCKET_BASE-57)
#define HYPORT_ERROR_SOCKET_LOOP  (HYPORT_ERROR_SOCKET_BASE-58)
#define HYPORT_ERROR_SOCKET_NOENT (HYPORT_ERROR_SOCKET_BASE-59)
#define HYPORT_ERROR_SOCKET_NOTDIR (HYPORT_ERROR_SOCKET_BASE-60)
#define HYPORT_ERROR_SOCKET_ROFS (HYPORT_ERROR_SOCKET_BASE-61)
#define HYPORT_ERROR_SOCKET_NOMEM (HYPORT_ERROR_SOCKET_BASE-62)
#define HYPORT_ERROR_SOCKET_NAMETOOLONG (J9PORT_ERROR_SOCKET_BASE-63)

#define HYPORT_ERROR_SOCKET_FIRST_ERROR_NUMBER HYPORT_ERROR_SOCKET_BASE
#define HYPORT_ERROR_SOCKET_LAST_ERROR_NUMBER HYPORT_ERROR_SOCKET_VALUE_NULL /* Equals last used error code */

#define HYPORT_ERROR_FILE_BASE -300
#define HYPORT_ERROR_FILE_OPFAILED (HYPORT_ERROR_FILE_BASE)
#define HYPORT_ERROR_FILE_EOF (HYPORT_ERROR_FILE_BASE-1)
#define HYPORT_ERROR_FILE_NOPERMISSION (HYPORT_ERROR_FILE_BASE-2)
#define HYPORT_ERROR_FILE_NOTFOUND (HYPORT_ERROR_FILE_BASE-3)
#define HYPORT_ERROR_FILE_NAMETOOLONG (HYPORT_ERROR_FILE_BASE-4)
#define HYPORT_ERROR_FILE_DISKFULL (HYPORT_ERROR_FILE_BASE-5)
#define HYPORT_ERROR_FILE_EXIST (HYPORT_ERROR_FILE_BASE-6)
#define HYPORT_ERROR_FILE_SYSTEMFULL (HYPORT_ERROR_FILE_BASE-7)
#define HYPORT_ERROR_FILE_NOENT (HYPORT_ERROR_FILE_BASE-8)
#define HYPORT_ERROR_FILE_NOTDIR (HYPORT_ERROR_FILE_BASE-9)
#define HYPORT_ERROR_FILE_LOOP (HYPORT_ERROR_FILE_BASE-10)
#define HYPORT_ERROR_FILE_BADF (HYPORT_ERROR_FILE_BASE-11)
#define HYPORT_ERROR_FILE_WOULDBLOCK (HYPORT_ERROR_FILE_BASE-12)
#define HYPORT_ERROR_FILE_INVAL (HYPORT_ERROR_FILE_BASE-13)
#define HYPORT_ERROR_FILE_LOCKED (HYPORT_ERROR_FILE_BASE-14)

#endif     /* hyporterror_h */
